home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / AIncludes / QuickEqu.a < prev    next >
Encoding:
Text File  |  1989-10-13  |  15.3 KB  |  477 lines  |  [TEXT/MPS ]

  1. ; Version: 2.26
  2. ; Created: Wednesday, July 12, 1989 at 1:35:29 PM
  3. ;
  4. ; File: QuickEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1984-1989
  8. ; All Rights Reserved
  9.  
  10. ; Transfer modes
  11.  
  12. srcCopy         EQU         0
  13. srcOr            EQU         1
  14. srcXor            EQU         2
  15. srcBic            EQU         3
  16. notSrcCopy        EQU         4
  17. notSrcOr        EQU         5
  18. notSrcXor        EQU         6
  19. notSrcBic        EQU         7
  20. patCopy         EQU         8
  21. patOr            EQU         9
  22. patXor            EQU         10
  23. patBic            EQU         11
  24. notPatCopy        EQU         12
  25. notPatOr        EQU         13
  26. notPatXor        EQU         14
  27. notPatBic        EQU         15
  28.  
  29. ; Arithmetic transfer modes
  30. blend            EQU         32
  31. addPin            EQU         33
  32. addOver         EQU         34
  33. subPin            EQU         35
  34. adMax            EQU         37
  35. subOver         EQU         38
  36. adMin            EQU         39
  37.  
  38. ; Definitions for Font Style Bits (right to left)
  39.  
  40. boldBit         EQU         0
  41.  
  42. ; Transparent mode constant
  43. transparent     EQU         36
  44. italicBit        EQU         1
  45. ulineBit        EQU         2
  46. outlineBit        EQU         3
  47. shadowBit        EQU         4
  48. condenseBit     EQU         5
  49. extendBit        EQU         6
  50.  
  51.  
  52. ; FontInfo record
  53.  
  54. ascent            EQU         0                        ; ascent [word]
  55. descent         EQU         2                        ; descent [word]
  56. widMax            EQU         4                        ; maximum width [word]
  57. leading         EQU         6                        ; leading [word]
  58.  
  59. ; Rectangle structure
  60.  
  61. topLeft         EQU         0                        ; upper left corner [point]
  62. botRight        EQU         4                        ; lower right corner [point]
  63. top             EQU         0                        ; top coordinate [word]
  64. left            EQU         2                        ; left coordinate [word]
  65. bottom            EQU         4                        ; bottom coordinate [word]
  66. right            EQU         6                        ; right coordinate [word]
  67.  
  68. ; Bitmap Structure
  69.  
  70. baseAddr        EQU         0                        ; bitmap base address [pointer]
  71. rowBytes        EQU         4                        ; row bytes (must be even) [word]
  72. bounds            EQU         6                        ; bounding box [rectangle]
  73. bitmapRec        EQU         14                        ; size of a bitmap
  74.  
  75. ; Cursor Structure
  76.  
  77. data            EQU         0                        ; visible bits [32 bytes]
  78. mask            EQU         $20                     ; mask bits [32 bytes]
  79. hotSpot         EQU         $40                     ; relative origin [point]
  80. cursRec         EQU         68                        ; size of a cursor
  81.  
  82. ; PenState record
  83.  
  84. psLoc            EQU         0                        ; pen location [point]
  85. psSize            EQU         4                        ; pen size [point]
  86. psMode            EQU         8                        ; pen mode [word]
  87. psPat            EQU         10                        ; pen [pattern]
  88. psRec            EQU         18                        ; size of pen state
  89.  
  90. ; Polygon record
  91.  
  92. polySize        EQU         0                        ; total bytes [word]
  93. polyBBox        EQU         2                        ; bounding box [rectangle]
  94. polyPoints        EQU         10                        ; vertices [Points]
  95.  
  96. ; Region Structure
  97.  
  98. rgnSize         EQU         0                        ; total bytes [word]
  99. rgnBBox         EQU         2                        ; bounding box [rectangle]
  100. rgnData         EQU         10                        ; region data [array]
  101.  
  102. ; Picture Structure
  103.  
  104. picSize         EQU         0                        ; total bytes [word]
  105. picFrame        EQU         2                        ; bounding box [rectangle]
  106. picData         EQU         10                        ; picture byte codes [array]
  107.  
  108. ; QDProcs structure
  109.  
  110. textProc        EQU         0                        ; [pointer]
  111. lineProc        EQU         4                        ; [pointer]
  112. rectProc        EQU         8                        ; [pointer]
  113. rRectProc        EQU         $C                        ; [pointer]
  114. ovalProc        EQU         $10                     ; [pointer]
  115. arcProc         EQU         $14                     ; [pointer]
  116. polyProc        EQU         $18                     ; [pointer]
  117. rgnProc         EQU         $1C                     ; [pointer]
  118. bitsProc        EQU         $20                     ; [pointer]
  119. commentProc     EQU         $24                     ; [pointer]
  120. txMeasProc        EQU         $28                     ; [pointer]
  121. getPicProc        EQU         $2C                     ; [pointer]
  122. putPicProc        EQU         $30                     ; [pointer]
  123. qdProcsRec        EQU         $34                     ; size of QDProcs record
  124.  
  125. ; GrafPort Structure
  126.  
  127. device            EQU         $0                        ; device code [word]
  128. portBits        EQU         $2                        ; port's bitmap [bitmap]
  129. portBounds        EQU         $8                        ; bounding box of bitmap [rect]
  130. portRect        EQU         $10                     ; port's rectangle [rect]
  131. visRgn            EQU         $18                     ; visible region [handle]
  132. clipRgn         EQU         $1C                     ; clipping region [handle]
  133.  
  134.  
  135. ; color manager equates
  136.  
  137. ; RGBColor structure
  138.  
  139. red             EQU         $0                        ;red channel intensity [short]
  140. green            EQU         $2                        ;green channel intensity[short]
  141. blue            EQU         $4                        ;blue channel intensity [short]
  142. rgbColor        EQU         $6                        ;size of record
  143.  
  144. ; ColorSpec structure
  145.  
  146. value            EQU         $0                        ;value field [short]
  147. rgb             EQU         $2                        ;rgb values [rgbColor]
  148. colorSpecSize    EQU         $8                        ;size of record
  149.  
  150. ; MatchRec structure
  151.  
  152. ;red EQU $0 ;defined in RGBColor
  153. ;green EQU $2 ;defined in RGBColor
  154. ;blue EQU $4 ;defined in RGBColor
  155. matchData        EQU         $6                        ; [long]
  156. matchRecSize    EQU         $A
  157. bkPat            EQU         $20                     ; background [pattern]
  158. fillPat         EQU         $28                     ; fill [pattern]
  159. pnLoc            EQU         $30                     ; pen location [point]
  160. pnSize            EQU         $34                     ; pen size [point]
  161. pnMode            EQU         $38                     ; pen mode [word]
  162. pnPat            EQU         $3A                     ; pen [pattern]
  163. pnVis            EQU         $42                     ; pen visible [word]
  164. txFont            EQU         $44                     ; text font [word]
  165. txFace            EQU         $46                     ; text face [word]
  166. txMode            EQU         $48                     ; text mode [word]
  167. txSize            EQU         $4A                     ; text size [word]
  168. spExtra         EQU         $4C                     ; space extra [fixed]
  169. fgColor         EQU         $50                     ; foreground color mask [long]
  170. bkColor         EQU         $54                     ; background color mask [long]
  171. colrBit         EQU         $58                     ; color bit [word]
  172. patStretch        EQU         $5A                     ; pattern stretch [word]
  173. picSave         EQU         $5C                     ; picture being saved [handle]
  174. rgnSave         EQU         $60                     ; region being saved [handle]
  175. polySave        EQU         $64                     ; polygon being saved [handle]
  176. grafProcs        EQU         $68                     ; QDProcs array [pointer]
  177. portRec         EQU         $6C                     ; size of grafport
  178.  
  179.  
  180. ; QuickDraw Global Variables
  181.  
  182.  
  183. GrafGlobals     EQU         0                        ; A5 offset to globptr
  184. thePort         EQU         0                        ;GrafPtr
  185. white            EQU         thePort-8                ;Pattern
  186. black            EQU         white-8                 ;Pattern
  187. gray            EQU         black-8                 ;Pattern
  188. ltGray            EQU         gray-8                    ;Pattern
  189. dkGray            EQU         ltGray-8                ;Pattern
  190. arrow            EQU         dkGray-68                ;Cursor
  191. screenBits        EQU         arrow-14                ;BitMap
  192. randSeed        EQU         screenBits-4            ;LONGINT
  193.  
  194. ; Color Separation
  195.  
  196. normalBit        EQU         0                        ; normal screen mapping
  197. inverseBit        EQU         1                        ; inverse screen mapping
  198. redBit            EQU         4                        ; RGB additive mapping
  199. greenBit        EQU         3                        ; for photos from screen
  200. blueBit         EQU         2
  201. cyanBit         EQU         8                        ; CMYBk subtractive mapping
  202. yellowBit        EQU         6
  203. magentaBit        EQU         7                        ; for ink jet printer
  204. blackBit        EQU         5
  205. blackColor        EQU         33
  206. whiteColor        EQU         30
  207. redColor        EQU         205
  208. greenColor        EQU         341
  209. blueColor        EQU         409
  210. cyanColor        EQU         273
  211. magentaColor    EQU         137
  212. yellowColor     EQU         69
  213.  
  214.  
  215. ; Standard Picture Comments
  216.  
  217. picLParen        EQU         0
  218. picRParen        EQU         1
  219.  
  220. ; QuickDraw verbs
  221.  
  222. frame            EQU         0
  223. paint            EQU         1
  224. erase            EQU         2
  225. invert            EQU         3
  226. fill            EQU         4
  227.  
  228. ; QuickDraw private global variables
  229.  
  230. wideOpen        EQU         randSeed-4                ;RgnHandle
  231. wideMaster        EQU         wideOpen-4                ;RgnPtr
  232. wideData        EQU         wideMaster-10            ;Fake Region
  233. rgnBuf            EQU         wideData-4                ;PointsHandle
  234. rgnIndex        EQU         rgnBuf-2                ;INTEGER
  235. rgnMax            EQU         rgnIndex-2                ;INTEGER
  236. playPic         EQU         rgnMax-4                ;Long
  237. qdSpare0        EQU         playPic-2                ;unused word
  238. thePoly         EQU         qdSpare0-4                ;POLYHANDLE
  239. polyMax         EQU         thePoly-2                ;INTEGER
  240. patAlign        EQU         polyMax-4                ;Point
  241. fontAdj         EQU         patAlign-4                ;Fixed Point
  242. fontPtr         EQU         fontAdj-4                ;long, ^FMOutput record
  243. playIndex        EQU         fontPtr-4                ;long
  244. fontData        EQU         playIndex-22            ;unused word
  245. lastGrafGlob    EQU         fontData
  246. grafSize        EQU         4-lastGrafGlob            ;total size in bytes
  247.  
  248. ; A record version of the Quickdraw globals
  249. ; It is here rather than with the complementary equates because it needs other equates
  250. ; ...(bitmapRec, grafSize, cursRec)
  251.  
  252. QDGlobals        RECORD        0,DECREMENT
  253. thePort         DS.L        1
  254. white            DS.B        8
  255. black            DS.B        8
  256. gray            DS.B        8
  257. ltGray            DS.B        8
  258. dkGray            DS.B        8
  259. arrow            DS.B        cursRec
  260. screenBits        DS.B        bitmapRec
  261. randSeed        DS.L        1
  262.                 ORG         -grafSize
  263.                 ENDR
  264.  
  265.  
  266. ;************** FROM HERE TO THE ENDIF IS ALL THE NEW STUFF FOR COLOR QUICKDRAW *************
  267.  
  268. hiliteBit        EQU         7                        ; flag bit in HiliteMode (lowMem flag)
  269.  
  270. ; Equates for resource ID's
  271.  
  272. defQDColors     EQU         127                     ; resource ID of clut for default QDColors
  273.  
  274. ;
  275. ; PixMap field offsets
  276.  
  277. pmBaseAddr        EQU         $0                        ; [long]
  278. pmNewFlag        EQU         $4                        ; [1 bit] upper bit of rowbytes is flag
  279. pmRowBytes        EQU         $4                        ; [word]
  280. pmBounds        EQU         $6                        ; [rect]
  281. pmVersion        EQU         $E                        ; [word] pixMap version number
  282. pmPackType        EQU         $10                     ; [word] defines packing format
  283. pmPackSize        EQU         $12                     ; [long] size of pixel data
  284. pmHRes            EQU         $16                     ; [fixed] h. resolution (ppi)
  285. pmVRes            EQU         $1A                     ; [fixed] v. resolution (ppi)
  286. pmPixelType     EQU         $1E                     ; [word] defines pixel type
  287. pmPixelSize     EQU         $20                     ; [word] # bits in pixel
  288. pmCmpCount        EQU         $22                     ; [word] # components in pixel
  289. pmCmpSize        EQU         $24                     ; [word] # bits per field
  290. pmPlaneBytes    EQU         $26                     ; [long] offset to next plane
  291. pmTable         EQU         $2A                     ; [long] color map
  292. pmReserved        EQU         $2E                     ; [long] MUST BE 0
  293. pmRec            EQU         $32                     ; size of pixMap record
  294.  
  295. ; pixel types
  296.  
  297. chunky            EQU         0
  298. chunkyPlanar    EQU         1
  299. planar            EQU         2
  300.  
  301. ; PixPat field offsets
  302. ;
  303.  
  304. patType         EQU         $0                        ; [word] type of pattern
  305. patMap            EQU         $2                        ; [long] handle to pixmap
  306. patData         EQU         $6                        ; [long] handle to data
  307. patXData        EQU         $A                        ; [long] handle to expanded pattern data
  308. patXValid        EQU         $E                        ; [word] flags whether expanded pattern valid
  309. patXMap         EQU         $10                     ; [long] handle to expanded pattern data
  310. pat1Data        EQU         $14                     ; [8 bytes] old-style pattern/RGB color
  311. ppRec            EQU         $1C                     ; size of pixPat record
  312.  
  313.  
  314. ; Pattern types
  315. ;
  316.  
  317. oldPat            EQU         0                        ; foreground/background pattern
  318. newPat            EQU         1                        ; self-contained color pattern
  319. ditherPat        EQU         2                        ; rgb value to be dithered
  320. oldCrsrPat        EQU         $8000                    ; old-style cursor
  321. cCrsrPat        EQU         $8001                    ; new-style cursor
  322.  
  323.  
  324. ; additional offsets in a color GrafPort
  325. ;
  326.  
  327. portPixMap        EQU         portBits                ; [long] pixelMap handle
  328. portVersion     EQU         portPixMap+4            ; [word] port version number
  329. grafVars        EQU         portVersion+2            ; [long] handle to more fields
  330. chExtra         EQU         grafVars+4                ; [word] character extra
  331. pnLocHFrac        EQU         chExtra+2                ; [word] pen fraction
  332. bkPixPat        EQU         bkPat                    ; [long] handle to bk pattern
  333. rgbFgColor        EQU         bkPixPat+4                ; [6 bytes] RGB components of fg color
  334. rgbBkColor        EQU         rgbFgColor+6            ; [6 bytes] RGB components of bk color
  335. pnPixPat        EQU         pnPat                    ; [long] handle to pen's pattern
  336. fillPixPat        EQU         pnPixPat+4                ; [long] handle to fill pattern 
  337.  
  338.  
  339. ; GDevice field offsets
  340. ;
  341.  
  342. gdRefNum        EQU         $0                        ; [word] unitNum of driver
  343. gdID            EQU         $2                        ; [word] client ID for search procs
  344. gdType            EQU         $4                        ; [word] fixed/CLUT/direct
  345. gdITable        EQU         $6                        ; [long] handle to inverse table
  346. gdResPref        EQU         $A                        ; [word] preferred resolution for inverse tables
  347. gdSearchProc    EQU         $C                        ; [long] search proc (list?) pointer
  348. gdCompProc        EQU         $10                     ; [long] complement proc (list?) pointer
  349. gdFlags         EQU         $14                     ; [word] grafDevice flags word
  350. gdPMap            EQU         $16                     ; [long] handle to pixMap describing device
  351. gdRefCon        EQU         $1A                     ; [long] reference value
  352. gdNextGD        EQU         $1E                     ; [long] handle of next gDevice
  353. gdRect            EQU         $22                     ; [rect] device's bounds in global coordinates
  354. gdMode            EQU         $2A                     ; [long] device's current mode
  355. gdCCBytes        EQU         $2E                     ; [word] depth of expanded cursor data
  356. gdCCDepth        EQU         $30                     ; [word] depth of expanded cursor data
  357. gdCCXData        EQU         $32                     ; [long] handle to cursor's expanded data
  358. gdCCXMask        EQU         $36                     ; [long] handle to cursor's expanded mask
  359. gdReserved        EQU         $3A                     ; [long] MUST BE 0
  360. gdRec            EQU         $3E                     ; size of GrafDevice record
  361.  
  362. ; VALUES FOR GDType
  363.  
  364. clutType        EQU         0                        ; 0 if lookup table
  365. fixedType        EQU         1                        ; 1 if fixed table
  366. directType        EQU         2                        ; 2 if direct values
  367.  
  368. ; BIT ASSIGNMENTS FOR GDFlags
  369.  
  370. gdDevType        EQU         0                        ; 0 = monochrome; 1 = color
  371. ramInit         EQU         10                        ; 1 if initialized from 'scrn' resource
  372. mainScreen        EQU         11                        ; 1 if main screen
  373. allInit         EQU         12                        ; 1 if all devices initialized
  374. screenDevice    EQU         13                        ; 1 if screen device [not used]
  375. noDriver        EQU         14                        ; 1 if no driver for this GDevice
  376. screenActive    EQU         15                        ; 1 if in use
  377.  
  378. ; CCrsr (Color Cursor) field offsets
  379. ;
  380. ; NOTE THAT THE FIRST FOUR FIELDS ARE PARALLEL TO THE FIRST FOUR FIELDS
  381. ; OF A PATTERN SO THAT PATCONVERT CAN BE USED TO EXPAND A CURSOR
  382. ;
  383.  
  384. crsrType        EQU         0                        ;[WORD] CURSOR TYPE
  385. crsrMap         EQU         crsrType+2                ;[LONG] HANDLE TO CURSOR'S PIXMAP
  386. crsrData        EQU         crsrMap+4                ;[LONG] HANDLE TO CURSOR'S COLOR DATA
  387. crsrXData        EQU         crsrData+4                ;[LONG] HANDLE TO EXPANDED DATA
  388. crsrXValid        EQU         crsrXData+4             ;[WORD] DEPTH OF EXPANDED DATA (0 IF NONE)
  389. crsrXHandle     EQU         crsrXValid+2            ;[LONG] HANDLE FOR FUTURE USE
  390. crsr1Data        EQU         crsrXHandle+4            ;[16 WORDS] ONE-BIT DATA
  391. crsrMask        EQU         crsr1Data+32            ;[16 WORDS] ONE-BIT MASK
  392. crsrHotSpot     EQU         crsrMask+32             ;[POINT] HOT-SPOT FOR CURSOR
  393. crsrXTable        EQU         crsrHotSpot+4            ;[LONG] TABLE ID FOR EXPANDED DATA
  394. crsrID            EQU         crsrXTable+4            ;[LONG] ID FOR CURSOR
  395. crsrRec         EQU         crsrID+4                ;SIZE OF CURSOR SAVE AREA
  396.  
  397.  
  398. ; CIcon (Color Icon) field offsets
  399. ;
  400.  
  401. iconPMap        EQU         0                        ;[PIXMAP] ICON'S PIXMAP
  402. iconMask        EQU         iconPMap+pmRec            ;[BITMAP] 1-BIT VERSION OF ICON ONE-BIT MASK FOR ICON
  403. iconBMap        EQU         iconMask+bitmapRec        ;[BITMAP] 1-BIT VERSION OF ICON
  404. iconData        EQU         iconBMap+bitmapRec        ;[LONG] HANDLE TO PIXMAP DATA
  405. ;FOLLOWED BY BMAP AND MASK DATA
  406. iconRec         EQU         iconData+4                ;SIZE OF ICON HEADER
  407.  
  408. ;
  409. ; Gamma Table format
  410. ;
  411. gVersion        EQU         0                        ; [word] gamma version number
  412. gType            EQU         gVersion+2                ; [word] gamma data type
  413. gFormulaSize    EQU         gType+2                 ; [word] Formula data size
  414. gChanCnt        EQU         gFormulaSize+2            ; [word] number of channels of data
  415. gDataCnt        EQU         gChanCnt+2                ; [word] number of values/channel
  416. gDataWidth        EQU         gDataCnt+2                ; [word] bits/corrected value (data packed to next larger byte size)
  417. gFormulaData    EQU         gDataWidth+2            ; [array] data for formulas, followed by gamma values
  418.  
  419.  
  420. ; EXTENSIONS TO THE QDPROCS RECORD
  421. ;
  422.  
  423. opcodeProc        EQU         $34                     ; [pointer]
  424. newProc1        EQU         $38                     ; [pointer]
  425. newProc2        EQU         $3C                     ; [pointer]
  426. newProc3        EQU         $40                     ; [pointer]
  427. newProc4        EQU         $44                     ; [pointer]
  428. newProc5        EQU         $48                     ; [pointer]
  429. newProc6        EQU         $4C                     ; [pointer]
  430. cqdProcsRec     EQU         $50                     ; size of QDProcs record
  431.  
  432. ; OFFSETS WITHIN GRAFVARS:
  433. ;
  434. rgbOpColor        EQU         0                        ; [6 bytes] color for addPin, subPin and average
  435. rgbHiliteColor    EQU         rgbOpColor+6            ; [6 bytes] color for hiliting
  436. pmFgColor        EQU         rgbHiliteColor+6        ; [4 bytes] palette handle for foreground color
  437. pmFgIndex        EQU         pmFgColor+4             ; [2 bytes] index value for foreground
  438. pmBkColor        EQU         pmFgIndex+2             ; [4 bytes] palette handle for background color
  439. pmBkIndex        EQU         pmBkColor+4             ; [2 bytes] index value for background
  440. pmFlags         EQU         pmBkIndex+2             ; [2 bytes] flags for Palette Manager
  441. grafVarRec        EQU         pmFlags+2                ; size of grafVar record
  442.  
  443. ; ColorTable field offsets
  444.  
  445. ctSeed            EQU         0                        ; [long] id number for table
  446. ctFlags         EQU         ctSeed+4                ; [word] hibh bit: 0 = PixMap; 1 = device
  447. ctSize            EQU         ctFlags+2                ; [word] number of entries in CTTable
  448. ctTable         EQU         ctSize+2                ; [variant] array of color spec
  449. ctRec            EQU         ctTable                 ; size of record without color table
  450. ctEntrySize     EQU         8                        ; size of each entry in table
  451. minSeed         EQU         1023                    ; minimum seed value (< minSeed reserved for rsrc ID's)
  452. protectBit        EQU         7                        ; protect bit in device color table
  453. reserveBit        EQU         6                        ; reserve bit in device color table
  454. invalColReq     EQU         -1                        ; invalid color table request
  455.  
  456. ; CProcRec structure
  457.  
  458. nxtComp         EQU         $0                        ;link to next proc [pointer]
  459. compProc        EQU         $4                        ;pointer to routine [pointer]
  460. cProcSize        EQU         8                        ; size of CProcRec
  461. ; SProcRec structure
  462.  
  463. nxtSrch         EQU         $0                        ;[pointer] link to next proc
  464. srchproc        EQU         $4                        ;[pointer] pointer to routine
  465. sProcSize        EQU         8                        ; size of SProcRec
  466.  
  467. ; request List structure
  468.  
  469. reqLSize        EQU         0                        ; request list size [word]
  470. reqLData        EQU         2                        ; request list data [words]
  471.  
  472.  
  473. ; Point structure
  474.  
  475. v                EQU         0                        ; vertical coordinate [word]
  476. h                EQU         2                        ; horizontal coordinate [word]
  477.